Service insertion for multicast traffic at boundary

ABSTRACT

Some embodiments of the invention provide novel methods for providing transparent services for multicast data messages traversing a network edge device operating at a boundary between two networks. The method analyzes data messages received at the network edge device to determine whether they require a service provided at the boundary and whether they are unicast or multicast (including broadcast). The method modifies a multicast destination media access control (MAC) address of a multicast data message requiring a service to be a unicast destination MAC address and provides, without processing by a standard routing function, the modified data message directly to an interface associated with a service node that provides the particular service required by the data message. The method receives the serviced data message, restores the multicast destination MAC address, and forwards the serviced data message to a set of destinations associated with the multicast destination address.

BACKGROUND

Currently systems for providing transparent services for multicast data messages at a network edge device prematurely forward the multicast data messages to the plurality of destinations of the multicast data message. Accordingly, a solution that provides a transparent service at a network edge device before forwarding the multicast data message to the plurality of destinations is required.

BRIEF SUMMARY

Some embodiments of the invention provide novel methods for providing a set of transparent services for multicast data messages traversing a network edge forwarding element (e.g., a forwarding element executing on an NSX edge) operating at a boundary between two networks (e.g., an external site and a local site operating the network edge device). The method analyzes data messages received at the network edge device to determine whether they require a service provided at the boundary and whether they are unicast or multicast (including broadcast). For data messages that are determined to be multicast data messages that require a particular service, the method modifies a multicast destination media access control (MAC) address of the data message to be a unicast destination MAC address and provides, without processing by a standard routing function, the modified data message directly to an interface associated with a service node that provides the particular service required by the data message. The method receives the serviced data message and modifies the destination MAC address to be the original multicast destination MAC address and provides the data message to the standard routing function to forward the serviced data message to a set of destinations associated with the multicast destination address.

By avoiding the routing function when providing the data message to the service node, the method ensures that the data message is not sent, before the service is provide, by the standard routing function to the destinations associated with the destination multicast internet protocol (IP) address. Furthermore, by changing only the destination MAC address while maintaining the destination multicast IP address throughout the data message processing, the method is able to generate the original destination multicast MAC address using known techniques (i.e., using the last 23 bits of the multicast IP address as the last 23 bits of a multicast MAC address where the first 25 bits of the multicast MAC address are a prefix that identifies the MAC address as a multicast MAC address).

Identifying that the data message is a multicast data message requiring a particular service, in some embodiments, includes using policy-based routing rules that each specify a set of data message attributes (e.g., an n-tuple, or an n-tuple and a VLAN tag, etc.) and a set of actions (e.g., modifying the data message, or identifying a next hop for the data message) for data messages with attributes that match the specified set of data message attributes. In some embodiments, an action specifies a universally unique identifier (UUID) of a service node for a required service. The UUID, for a first set of services, identifies a service node cluster with a specific service provide node further identified with a separate UUID or a network or link layer address identifying a particular service node associated with the cluster's UUID. For a second set of services, the UUID identifies a particular service node directly. A set of UUIDs identifying particular service nodes may also be specified in the policy-based routing rule with one of the UUIDs being selected at random or based on a load balancing operation to provide the service for a particular data message. The particular service node may operate on a physical device separate from the network edge device or may operate on the network edge device (as a virtual machine, container, etc.). Additionally, the service node be a third party service node. The different uses of UUIDs, in some embodiments, depend on the structure of the service nodes.

For policy-based rules that apply to unicast as well as multicast data messages, in some embodiments, a separate determination that the data message is a multicast data message is made. In some embodiments, the determination is based on (1) a destination IP address being in a range of IP addresses assigned to multicast data messages (i.e., 224.0.0.0/4), (2) a bit in the destination MAC address (e.g., the last bit of the first octet) that indicates that the MAC address is a multicast MAC address, or (3) on both the IP and MAC addresses. The determination, in some embodiments, is a further condition specified in the actions of the policy-based routing rule.

For data messages identified as being multicast and as requiring a service, the method uses the UUID of a particular service node identified from the policy-based routing rule to identify a set of interfaces associated with the particular service node. The set of interfaces includes a first and second interface that are used as source and destination interfaces with the direction of the data message (north to south or south to north) determining, in some embodiments, which interface is used as a source and which is used as a destination. The identified interfaces, in some embodiments, are identified by MAC addresses associated with the first and second interfaces. The MAC addresses are then used to replace the source and destination MAC addresses of the received multicast data message and the modified data message is sent out the interface identified as the source interface (corresponding to the MAC address used as the source MAC address of the modified data message).

Upon receiving the modified data message, the service node provides the service (e.g., services the data message) and returns the serviced data message to the interface identified as the destination interface (i.e., the interface having the MAC address used as the destination MAC address in the modified data message). In some embodiments, the service node is a bump-in-the-wire service node that does not alter the header values of the serviced data message. In all embodiments, the service node preserves the destination IP address and the destination MAC address so as to enable delivery to the proper interface and the recovery of the multicast MAC address. The service node (or switches associated with the service node) forward the modified data message based on layer 2 (e.g., MAC) addresses such that the modified data message is treated as a unicast data message based on the unicast MAC address of the destination interface.

As discussed above, when the serviced data message is returned, the method modifies the destination MAC address of the serviced data message to be a multicast MAC address corresponding to the unmodified destination multicast IP address of the data message. The modification, in some instances is performed using a function that calculates a multicast MAC address from the multicast IP address (e.g., by using a prefix associated with multicast MAC addresses and a last 23 bits that match the last 23 bits of the multicast IP address), while in other embodiments a lookup table that stores the destination multicast IP and the original corresponding destination multicast MAC address is used to identify the correct destination multicast MAC address for the serviced data message. In some embodiments, the serviced data message is also modified by adding or modifying a tag bit to indicate that the particular service has been performed. The tag value (e.g., ‘0’ or ‘1’) is used, in some embodiments, in a policy-based routing rule as a condition for requiring a service, such that a set of specified attributes of a tagged data message match all the attributes specified in the policy-baser routing rule except for the tag value and based on the mismatch in tag values the data message is processed by the standard routing function without having the service provided for a second time. In some embodiments, a service chain may be identified with a set of multiple tags identifying each corresponding to a different service required by the data message.

The standard routing function forwards the multicast data message by identifying outgoing interfaces associated with the multicast IP address. In some embodiments, the outgoing interfaces are identified in an outgoing interfaces (OIF) list that is populated with all interfaces over which a join message has been received for the particular multicast group (i.e., multicast IP address). After identifying the outgoing interfaces, the routing function modifies each data message to identify the IP and MAC addresses of the interface on which the data message is forwarded as the source IP and MAC address of the data message while leaving the destination IP and MAC addresses as the multicast IP and MAC addresses of the original data message. This allows the data message to be identified by downstream routers as a multicast data message and to not return the data message to the interface from which it was received.

The preceding Summary is intended to serve as a brief introduction to some embodiments of the invention. It is not meant to be an introduction or overview of all inventive subject matter disclosed in this document. The Detailed Description that follows and the Drawings that are referred to in the Detailed Description will further describe the embodiments described in the Summary as well as other embodiments. Accordingly, to understand all the embodiments described by this document, a full review of the Summary, Detailed Description, the Drawings and the Claims is needed. Moreover, the claimed subject matters are not to be limited by the illustrative details in the Summary, Detailed Description and the Drawing.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features of the invention are set forth in the appended claims. However, for purposes of explanation, several embodiments of the invention are set forth in the following figures.

FIG. 1 conceptually illustrates a process for providing a service at the network edge.

FIG. 2 illustrates two different views of a network configured to use a centralized logical router implementation to provide a service at the network edge.

FIG. 3 conceptually illustrates a network edge device of some embodiments processing a multicast data message requiring a service.

FIG. 4 conceptually illustrates a process for processing data messages received at the network edge device.

FIG. 5 conceptually illustrates a computer system with which some embodiments of the invention are implemented.

DETAILED DESCRIPTION

In the following detailed description of the invention, numerous details, examples, and embodiments of the invention are set forth and described. However, it will be clear and apparent to one skilled in the art that the invention is not limited to the embodiments set forth and that the invention may be practiced without some of the specific details and examples discussed.

As used in this document, the term data packet, packet, data message, or message refers to a collection of bits in a particular format sent across a network. It should be understood that the term data packet, packet, data message, or message may be used herein to refer to various formatted collections of bits that may be sent across a network, such as Ethernet frames, IP packets, TCP segments, UDP datagrams, etc. While the examples below refer to data packets, packets, data messages, or messages, it should be understood that the invention should not be limited to any specific format or type of data message. Also, as used in this document, references to L2, L3, L4, and L7 layers (or layer 2, layer 3, layer 4, layer 7) are references to the second data link layer, the third network layer, the fourth transport layer, and the seventh application layer of the OSI (Open System Interconnection) layer model, respectively.

A user-defined logical network as used in this application, refers to a particular logical abstraction of a network. In some embodiments, the logical abstraction includes logical counterparts to network elements of a physical network such as forwarding elements (e.g., switches, hubs, routers, bridges, etc.), load balancers, and firewalls. The logical forwarding elements (e.g., a logical switch or logical router) in some embodiments are implemented by a set of MFEs (e.g., physical or virtual/software switches, or routers) executing on host machines. A particular host machine may host data compute nodes (DCNs) (e.g., containers or virtual machines (VMs)) connected to multiple different logical networks and the set of MFEs implements all the logical networks to which the DCNs logically connect. Additional details of the structure and function of logical networks are described in U.S. Pat. No. 9,787,605 which is hereby incorporated by reference.

Some embodiments of the invention provide novel methods for providing a transparent service for multicast data messages traversing a network edge forwarding element (e.g., a network edge forwarding element executing on an NSX edge) operating at a boundary between two networks (e.g., an external site and a local site operating the network edge device). In some embodiments, the local site implements a logical network that includes machines that may be sources or destinations of multicast data messages.

FIG. 1 conceptually illustrates a process 100 for providing a service at the network edge. Process 100 will be described in relation to FIG. 2 illustrating an exemplary embodiment in which the process 100 is performed. FIG. 2 illustrates two different views of a network configured to use a centralized logical router implementation to provide a service at the network edge. FIG. 2 specifically illustrates the configuration view on the left of the dotted line, which represents a logical network 200 as designed by a user. As shown, the logical router 215 is part of a logical network 200 that includes the logical router 215 and two logical switches 205 and 210. The two logical switches 205 and 210 each have VMs that connect to logical ports. While shown as VMs in these figures, it should be understood that other types of data compute nodes (e.g., namespaces, etc.) may connect to logical switches in some embodiments. The logical router 215 also includes two ports that connect to the external physical network 220 and an additional two ports that connect to a service node 225 for providing a service to data messages received at the logical router.

FIG. 2 illustrates, to the right of the dotted line, the physical centralized implementation 270 of the logical router 215. As shown, each of the VMs that couples to one of the logical switches 205 and 210 in the logical network 200 operates on a host machine 205. The MFEs 230 that operate on these host machines are virtual switches (e.g., OVS, ESX) that operate within the hypervisors or other virtualization software on the host machines. These MFEs perform first-hop switching for the logical switches 205 and 210 for packets sent by the VMs of the logical network 200. The MFEs 230 (or a subset of them) also may implement logical switches (and distributed logical routers) for other logical networks if the other logical networks have VMs that reside on the host machines 235 as well. The logical router 215 is implemented by a set of service routers (SRs) 250 and 255 (e.g., network edge forwarding elements). In the depicted embodiment, the SRs operate in active-standby mode, with one of the SRs active and the other operating as a standby (in case of the failure of the active SR). In other embodiments, the SRs operate in an active-active mode (for load balancing non-stateful services). Each of the logical switches 205 and 210 has a connection to each of the SRs 250 and 255.

The two service routers 250 and 255 each operate on a different gateway machine 240 and 245 (e.g., network edge devices). The gateway machines 240 and 245 are host machines similar to the machines 235 in some embodiments, but host service routers rather than user VMs. In some embodiments, the gateway machines 240 and 245 each include an MFE as well as the service router, in order for the MFE to handle any logical switching necessary. For instance, packets sent from the external network 220 may be routed by the service router implementation on the gateway and then subsequently switched by the MFE on the same gateway. The gateway devices are each shown as connecting to a service node (SN) 225 shown as a separate device. The SNs 225 are implemented on the gateway devices 240 and 245 as a namespace, a virtual machine, or a container in different embodiments. In embodiments with multiple service nodes there may be a combination of local and external service nodes in any form factor described above.

The SRs may be implemented in a namespace, a virtual machine, or as a VRF in different embodiments. The SRs may operate in an active-active or active-standby mode in some embodiments, depending on whether any stateful services (e.g., firewalls) are configured on the logical router. When stateful services are configured, some embodiments require only a single active SR. In some embodiments, the active and standby service routers are provided with the same configuration, but the MFEs 230 are configured to send packets via a tunnel to the active SR (or to the MFE on the gateway machine with the active SR). Only if the tunnel is down will the MFE send packets to the standby gateway.

The gateway machines 240 and 245 are configured, in some embodiments, to provide received data messages to service nodes executing locally on gateway machines or to service nodes executing on other physical machines (e.g., SNs 225) to provide a service to the received data messages. The service nodes, in some embodiments, are provided by third-party vendors and provide transparent (e.g., bump-in-the-wire) services that do not change the source and destination addresses of a serviced data message.

Process 100 of FIG. 1, in some embodiments, is performed by a network edge forwarding element (e.g., an SR 250 or 255 on a gateway machine 240 or 245). The process begins by receiving (at 105) a data message at the gateway machine. The data message may be received from a machine within the logical network (e.g., a virtual machine) or from a source in the external network 220. In the process described the data message is assumed to be a multicast data message that requires a service and a more complete description of a process 400 for handling all types of data messages is conceptually illustrated in FIG. 4.

After receiving (at 105) the data message the process 100 analyzes the data message and determines (at 110) that the data message is a multicast data message that requires a service. The determination, in some embodiments, is based on a set of policy-based routing (PBR) rules that define policies for handling data messages matching specified criteria. In some embodiments, the specified criteria include criteria that are not in L2-L4 headers. Additionally, the policies may specify actions in addition to, or instead, of identifying a next hop. For example, a PBR rule, in some embodiments, specifies a UUID associated with a service node to provide a service required for the data message. In some embodiments, a separate determination is made as to whether a data message requiring a service based on a PBR rule is a multicast data message (i.e., has a multicast destination address). The determination is made based on at least one of a destination internet protocol (IP) address (e.g., by identifying the multicast prefix 224.0.0.0/4) and a destination media access control (MAC) address (e.g., by identifying that the last bit of the first octet is equal to 1).

Once the process 100 determines (at 110) that the data message is a multicast data message that requires a service, the service changes (at 115) the multicast destination MAC address to a unicast destination MAC address associated with a service node that provides the service to the data message. In some embodiments, the service node is identified in the determining operation as the determination is based on a PBR rule identifying a service node as a next hop and providing information to determine at least one MAC address associated with the service node.

After changing (at 115) the multicast destination MAC address into the unicast destination MAC address, the process 100 provides (at 120) the data message to the service node for the service node to provide the service. In some embodiments, providing the data message to the service node includes bypassing a routing function (i.e., not using layer 3 attributes of the data message to forward the message) in order to avoid providing the unserviced data message to a set of outgoing interfaces associated with the multicast destination IP address. Instead, the process provides the data message to the service node using a layer 2 processing that identifies destinations based on the MAC address.

Once the service node has provided the required service, the service node sends the serviced data message back to the network edge forwarding element (e.g., SR 250 or 255) which receives (at 125) the data message. The process 100 then restores (at 130) the multicast destination MAC to the original multicast destination MAC address of the received data message. Restoring (at 130) the MAC address, in some embodiments, is performed by a module in the network edge forwarding element that determines that the data message is a multicast data message that should have its multicast MAC address restored based on at least the presence of a multicast destination IP address and at least one of a service interface and a determination that the data message has been received from the service engine. In some embodiments, the multicast destination MAC address is stored in a table associated with the multicast destination IP address and restoring the multicast destination MAC address includes identifying the multicast destination MAC address using the multicast destination IP address. In other embodiments, the multicast destination MAC address is generated from the multicast destination IP address through a known process (i.e., using the last 23 bits of the multicast IP address as the last 23 bits of a multicast MAC address where the first 25 bits of the multicast MAC address are a prefix that identifies the MAC address as a multicast MAC address).

Once the multicast destination MAC address has been restored (at 130), the process forwards (at 135) the serviced data message to the set of destinations. In some embodiments, forwarding the data message includes identifying outgoing interfaces associated with the multicast IP address. In some embodiments, the outgoing interfaces are identified in an outgoing interfaces (OIF) list that is populated with all interfaces over which a join message has been received for the particular multicast group (i.e., multicast IP address) (excluding the interface on which the multicast data message was received. After identifying the outgoing interfaces, the routing function modifies each data message to identify the IP and MAC addresses of the interface on which the data message is forwarded as the source IP and MAC address of the data message while leaving the destination IP and MAC addresses as the multicast IP and MAC addresses of the original data message. This allows the data message to be identified by downstream routers as a multicast data message and to not return the data message to the interface from which it was received.

For network traffic coming from the external network 220, the set of outgoing interfaces includes the interfaces of the SR 250 or 255 that are connected to MFEs 230 executing on hosts 235 with machines (e.g., VMs) that have joined the multicast group associated with the multicast destination IP address of the data message. The SR, in some embodiments, will first forward the traffic to a single interface connected to a distributed router implemented on the gateway device 240 or 245 and then perform the distributed router processing to identify the set of outgoing interfaces associated with the MFEs 230 or the hosts 235. For network traffic being sent to the external network 220, the set of outgoing interfaces include any routers in the external network connected to the SR 250 or 255 (or gateway device 240 or 245) that have joined the multicast group associated with the multicast destination IP address. Once the serviced data message is forwarded (at 135) the process 100 ends.

By avoiding the routing function when providing the data message to the service node, the method ensures that the data message is not sent, before the service is provide, by the standard routing function to the destinations associated with the destination multicast internet protocol (IP) address. Furthermore, by changing only the destination MAC address while maintaining the destination multicast IP address throughout the data message processing, the method is able to generate the original destination multicast MAC address using known techniques (i.e., using the last 23 bits of the multicast IP address as the last 23 bits of a multicast MAC address where the first 25 bits of the multicast MAC address are prefix that identifies the MAC address as a multicast MAC address).

FIG. 3 illustrates a system 300 including an exemplary network edge device 310 (similar to gateway device 240) providing a transparent service for a multicast data message traversing the network edge device 310. The network edge device 310 operates between a first (external) network 350 and a second (internal) network 360. In some embodiments, network edge device 310 is part of network 360, but is shown outside the network 360 for clarity. The network edge device is illustrated as executing a routing module 330 that includes the policy based routing rules 331 and a standard routing function 332. The standard routing function, in some embodiments, performs standard routing operations that identify an outgoing interface for a unicast data messages (or interfaces for multicast/broadcast data messages) based on a destination IP address. In some embodiments, the policy-based rules 331 are used to analyze data messages before the data messages are provided to the standard routing function 332. Additional logical switches and other components of the network edge device 310 are omitted here for clarity.

Network edge device 310 also includes a set of interfaces 301 (e.g., “IF_N” a north-facing interface) and 304-307 (e.g., IF_S1 to IF_S4 a set of south-facing interfaces) connecting the network edge device 310 to the external and internal networks, respectively. Additionally, the network edge device 310 has a set of interfaces 302 and 303 (IF_SN1 and IF_SN2, respectively) for connecting to a service node (SN) 320. As shown the interfaces of the network edge device 310 correspond to (unlabeled) interfaces of the routing module 330. One of ordinary skill in the art will understand that the SPN 320 may instead be implemented as a container or service virtual machine executing on the network edge device 310 and represents only a single service node and associated interfaces where other embodiments will have multiple service nodes or service node clusters each with their own associated interfaces.

FIG. 3 illustrates a multicast data message 340 being received at the north-facing interface (IF_N) 301 and being processed through the routing module 330 to forward the data message to SPN 320. The data message is returned to the network edge device 310 and forwarded out south-facing interfaces 304-306 (IF_SN1 to IF_SN3) associated with the destination multicast IP address. In some embodiments, the policy-based routing rules 331 are responsible for directing the original data message to the SPN 320 and directing serviced data messages to the standard routing function 332, while the standard routing module 332 is responsible for identifying the outgoing interfaces for a serviced multicast data message (e.g., interfaces 304-306 in the illustrated embodiment). The circled number “1”-“4” identify different points in the processing of a data message through the network edge device 310 and service node 320. Additionally, the key in the lower left hand corner indicates the destination IP (DIP) and destination MAC (DMAC) address of the data message at the different identified points in the processing. As shown, the data message at points “1” and “4” have the destination IP and destination MAC of the originally received packet, while data messages “2” and “3” have the original destination IP address and the modified destination MAC address used to direct the data message to the service node 320.

FIG. 3 also illustrates a set of exemplary policy-based rules (i.e., rules 1a, 1b, 2a, and 2b) in the policy-based rules 331 that apply to a multicast data message having a particular multicast destination IP (“MIP1”). Rules 1a and 1b are one set of rules that might be specified (e.g., by a user) to apply to south-bound multicast traffic for data messages having multicast destination IP address MIP1. Rule 1a is specified to be of higher priority and based on the specified SMAC and DMAC applies to a data message returned from the SPN 320 for south-bound data messages (assuming that south-bound data messages are sent out IF_SN1 to IF_SN2 with north-bound data messages being sent out IF_SN2 to IF_SN1). The action fields of rule 1a specify that the packet is tagged as having been serviced and that the DMAC is updated with the MAC address (“MMAC1”) corresponding to the destination multicast IP address MIP1. As specified in FIG. 3, the rule uses wildcard values (“*”) for source IP (SIP), but one of ordinary skill in the art will appreciate that a specific IP address or subnet is used in some embodiments to specify the source IP address.

Rule 1b is specified to apply to a south-bound multicast data message received at the interface IF_N 301 with destination IP address MIP1 with any source IP and source MAC address (indicated by the wildcard symbol *). Rule 1b also includes a requirement that the tag value is equal to 0 such that any data message that hits rule 1a will no longer hit rule 1b). However, for newly received multicast data messages, the action specified in rule 1b updates the source and destination MAC to be the MAC addresses of IF_SN1 and IF_SN2 respectively so that the south-bound data message is passed through the SPN 320 in a direction that indicates that the data message is south-bound. Rules 2a and 2b that would apply to a north-bound data message with destination multicast IP address MIP1 are also illustrated to indicate that the interfaces/MAC addresses identified as the source and destination interfaces/MAC addresses are reversed in rule 2b to indicate that the data message is north-bound. One of ordinary skill in the art will understand that the illustrated rules are merely exemplary and that many more rules will be specified in some embodiments, and that the rules may specify any relevant data message attribute and associated actions.

FIG. 4 conceptually illustrates a process 400 for processing data messages received at a network edge device (e.g., network edge device 3110) to provide forwarding and a set of transparent services (e.g., edge services such as network address translation (NAT), firewall, load balancing, etc.). The process 400 is performed by a network edge device, in some embodiments, although one of ordinary skill in the art will appreciate that different operations of process 400 are performed by different elements of the network edge device. Process 400 begins (at 405) by receiving a data message. In some embodiments, the data message is a data message traversing the network edge device (e.g., a north-south data message) received at any one of a plurality of south-facing or north-facing interfaces of the network edge device. In some embodiments, the data message is a data message internal to the southern network (e.g., an east-west data message) that requires a centralized service provided at the network edge device.

After receiving (at 405) the data message, the process 400 determines (at 410) whether the data message requires a service. Identifying that the data message requires a particular service, in some embodiments, includes using policy-based routing rules that each specify a set of data message attributes (e.g., an n-tuple, or an n-tuple and a VLAN tag, etc.) and a set of actions (e.g., modifying the data message, or identifying a next hop for the data message) for data messages with attributes that match the specified set of data message attributes. In some embodiments, identifying that a data message requires a particular service includes an action that specifies a universally unique identifier (UUID) of a service node for a required service.

In some embodiments, the UUID for a first set of services identifies a service node cluster and a particular service provide node in the service node cluster is further identified using a separate UUID or a network or link layer address identifying the particular service node of the service node cluster (i.e., associated with the cluster's UUID). For a second set of services, the UUID identifies, in some embodiments, a particular service node directly. In some embodiments, a set of UUIDs identifying particular service nodes may also be specified in the policy-based routing rule with one of the UUIDs being selected at random or based on a load balancing operation to provide the service for a particular data message. The particular service node identified using the policy-base routing rules may operate on a physical device separate from the network edge device or may operate on the network edge device (as a virtual machine, container, etc.). Additionally, the service node be a third party service node. The different uses of UUIDs, in some embodiments, depend on the structure of the service nodes.

If the process 400 determines (at 410) that the data message does not require a service, the process 400 forwards (at 455) the data message. Determining that a data message does not require a service, in some embodiments, includes not finding a matching policy-based routing rule in a set of policy-based routing rules. In some embodiments, forwarding the data message includes processing the data message using the standard routing function of the network edge device to determine a next hop for the data message. The standard routing function, in some embodiments, determines a next hop based on the destination IP address (whether unicast or multicast).

If the process 400 determines (at 410) that the data message requires a service, the process 400 identifies (at 415) a set of interfaces associated with the service node for the required service. The set of interfaces, in some embodiments, are a pair of interfaces that are both connected to the network edge device such that the data message is sent and received by the network edge device without any change in the data message headers performed by the service node (e.g., the service is provided transparently, or as a bump-in-the-wire service). In some embodiments, the set of interfaces is identified using the UUIDs identified from the policy-based routing rule that matches the received data message. The UUIDs, in some embodiments are used to identify MAC addresses of the interfaces. One of ordinary skill in the art will appreciate that there are a number of other ways to identify the set of interfaces associated with a particular service node or cluster selected to provide a service.

Some embodiments not only identify the set of interfaces, but also identify which interface will be designated the source and which will be designated the destination based on the interface of the network edge device on which the data message was received. Identifying one interface as a destination for all traffic traversing from a north-facing interface to a south-facing interface and the other interface as the destination for all traffic in the other direction allows the data messages direction to be assessed from the destination MAC address of the data messages received from the service nodes.

After identifying (at 415) the interfaces associated with a service node, the process 400 determines (at 420) if the data message is a multicast data message. In some embodiments, the determination is based on (1) a destination IP address being in a range of IP addresses assigned to multicast data messages (i.e., 224.0.0.0/4), (2) a bit in the destination MAC address (e.g., the last bit of the first octet) that indicates that the MAC address is a multicast MAC address, or (3) on both the IP and MAC addresses. The determination, in some embodiments, is a further condition specified in the actions of the policy-based routing rule. For policy-based rules that apply to unicast as well as multicast data messages, in some embodiments, this determination is an independent determination of whether the data message is a multicast data. In some embodiments, the determination is inherent in a policy-based rule and does not require the separate determination of operation 420.

If the process determines (at 420) that the data message is not a multicast data message the process 400 uses (at 430) the standard routing function to route/forward the unicast data message to the identified service node interfaces. Alternatively, if the process determines (at 420) that the data message is a multicast data message, the process bypasses the standard routing function and updates (at 425) the source and destination MAC addresses to those identified for the service node.

After either processing (at 430) the data message by the standard routing function or updating (at 425) the MAC addresses of the data message, the data message is sent (at 435) out of the interface identified as the outgoing (source) interface for the service node (e.g., based on the direction of the traffic) to be returned on the interface identified as the destination interface. Upon receiving the modified data message, the service node provides the service (e.g., services the data message) and returns the serviced data message to the interface identified as the destination interface (i.e., the interface having the MAC address used as the destination MAC address in the modified data message). In some embodiments, the service node is a bump-in-the-wire service node that does not alter the header values of the serviced data message. In all embodiments, the service node preserves the destination IP address and the destination MAC address so as to enable delivery to the proper interface and the recovery of the multicast MAC address. The service node (or switches associated with the service node) forward the modified data message based on layer 2 (e.g., MAC) addresses such that the modified data message is treated as a unicast data message based on the unicast MAC address of the destination interface.

The serviced data message is then received (at 440) by the network edge device from the service node. When the serviced data message is returned, the method determines (at 445) if the data message is a multicast data message. In some embodiments, the determination is based on the destination IP address (e.g., if the destination IP address is in the 244.0.0.0/4 subnet). If the process determines (at 445) that the data message is a multicast data message, the process restores (at 450) the destination MAC address of the serviced data message to be the multicast MAC address corresponding to the unmodified destination multicast IP address of the data message. The restoration, in some instances is performed using a function that calculates a multicast MAC address from the multicast IP address (e.g., by using a prefix associated with multicast MAC addresses and a last 23 bits that match the last 23 bits of the multicast IP address), while in other embodiments a lookup table that stores the destination multicast IP and the original corresponding destination multicast MAC address used to identify the correct destination multicast MAC address for the serviced data message.

In some embodiments, the serviced data message is also modified (at 450) by adding or modifying a tag bit to indicate that the particular service has been performed. The tag value (e.g., ‘0’ or ‘1’) is used, in some embodiments, in a policy-based routing rule as a condition for requiring a service, such that a set of specified attributes of a tagged data message match all the attributes specified in the policy-based routing rule except for the tag value and based on the mismatch in tag values the data message is processed by the standard routing function without having the service provided for a second time. In some embodiments, a service chain may be identified with a set of multiple tags identifying each corresponding to a different service required by the data message.

After the multicast data message has its multicast MAC address restored (at 450) or the data message is determined (at 445) to be a unicast data message the data message is forwarded (at 455) to the destination (or set of destinations for a multicast data message). In some embodiments, the forwarding is performed by a standard routing function that identifies a destination (or set of destinations) based on the destination IP address of the data message. For multicast data messages a standard routing function forwards the multicast data message by identifying outgoing interfaces associated with the multicast IP address. In some embodiments, the outgoing interfaces are identified in an outgoing interfaces (OIF) list that is populated with all interfaces over which a join message has been received for the particular multicast group (i.e., multicast IP address). After identifying the outgoing interfaces, the routing function modifies each data message to identify the IP and MAC addresses of the interface on which the data message is forwarded as the source IP and MAC address of the data message while leaving the destination IP and MAC addresses as the multicast IP and MAC addresses of the original data message. This allows the data message to be identified by downstream routers as a multicast data message and to not return the data message to the interface from which it was received.

Many of the above-described features and applications are implemented as software processes that are specified as a set of instructions recorded on a computer readable storage medium (also referred to as computer readable medium). When these instructions are executed by one or more processing unit(s) (e.g., one or more processors, cores of processors, or other processing units), they cause the processing unit(s) to perform the actions indicated in the instructions. Examples of computer readable media include, but are not limited to, CD-ROMs, flash drives, RAM chips, hard drives, EPROMs, etc. The computer readable media does not include carrier waves and electronic signals passing wirelessly or over wired connections.

In this specification, the term “software” is meant to include firmware residing in read-only memory or applications stored in magnetic storage, which can be read into memory for processing by a processor. Also, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while remaining distinct software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that together implement a software invention described here is within the scope of the invention. In some embodiments, the software programs, when installed to operate on one or more electronic systems, define one or more specific machine implementations that execute and perform the operations of the software programs.

FIG. 5 illustrates the system 500 of some embodiments. As shown, this system includes multiple virtualized hosts 505 and 510, a set of network manager computers 520, and a network edge device 515. The virtualized hosts 505 and 510 host compute nodes that can be sources and destinations of data messages sent through network 575 and network edge device 515 to or from a compute node in network 585. The network edge device is shown executing a set of service engines (e.g., service engine instances) 545. As shown in FIG. 5, the hosts 505 and 510, the controller set 520, and the network edge device 515 communicatively couple through a network 575, which can include a local area network (LAN), a wide area network (WAN) or a network of networks (e.g., Internet).

The set of network manager computers 520 provide control and management functionality for defining and managing the instantiation of one or more GVMs on each host (for the purposes of this discussion, network controllers 520 includes both management plane and control plane controllers). These controllers are also responsible, in some embodiments, for configuring the network edge device to provide the functionality described above. These controllers, in some embodiments, also provide control and management functionality for defining and managing multiple logical networks that are defined on the common software forwarding elements of the hosts.

Many of the above-described features and applications are implemented as software processes that are specified as a set of instructions recorded on a computer readable storage medium (also referred to as computer readable medium). When these instructions are executed by one or more processing unit(s) (e.g., one or more processors, cores of processors, or other processing units), they cause the processing unit(s) to perform the actions indicated in the instructions. Examples of computer readable media include, but are not limited to, CD-ROMs, flash drives, RAM chips, hard drives, EPROMs, etc. The computer readable media does not include carrier waves and electronic signals passing wirelessly or over wired connections.

In this specification, the term “software” is meant to include firmware residing in read-only memory or applications stored in magnetic storage, which can be read into memory for processing by a processor. Also, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while remaining distinct software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that together implement a software invention described here is within the scope of the invention. In some embodiments, the software programs, when installed to operate on one or more electronic systems, define one or more specific machine implementations that execute and perform the operations of the software programs.

FIG. 5 conceptually illustrates a computer system 500 with which some embodiments of the invention are implemented. The computer system 500 can be used to implement any of the above-described hosts, controllers, and managers. As such, it can be used to execute any of the above described processes. This computer system includes various types of non-transitory machine readable media and interfaces for various other types of machine readable media. Computer system 500 includes a bus 505, processing unit(s) 510, a system memory 525, a read-only memory 530, a permanent storage device 535, input devices 540, and output devices 545.

The bus 505 collectively represents all system, peripheral, and chipset buses that communicatively connect the numerous internal devices of the computer system 500. For instance, the bus 505 communicatively connects the processing unit(s) 510 with the read-only memory 530, the system memory 525, and the permanent storage device 535.

From these various memory units, the processing unit(s) 510 retrieve instructions to execute and data to process in order to execute the processes of the invention. The processing unit(s) may be a single processor or a multi-core processor in different embodiments. The read- only-memory (ROM) 530 stores static data and instructions that are needed by the processing unit(s) 510 and other modules of the computer system. The permanent storage device 535, on the other hand, is a read-and-write memory device. This device is a non-volatile memory unit that stores instructions and data even when the computer system 500 is off Some embodiments of the invention use a mass-storage device (such as a magnetic or optical disk and its corresponding disk drive) as the permanent storage device 535.

Other embodiments use a removable storage device (such as a floppy disk, flash drive, etc.) as the permanent storage device. Like the permanent storage device 535, the system memory 525 is a read-and-write memory device. However, unlike storage device 535, the system memory is a volatile read-and-write memory, such a random access memory. The system memory stores some of the instructions and data that the processor needs at runtime. In some embodiments, the invention's processes are stored in the system memory 525, the permanent storage device 535, and/or the read-only memory 530. From these various memory units, the processing unit(s) 510 retrieve instructions to execute and data to process in order to execute the processes of some embodiments.

The bus 505 also connects to the input and output devices 540 and 545. The input devices enable the user to communicate information and select commands to the computer system. The input devices 540 include alphanumeric keyboards and pointing devices (also called “cursor control devices”). The output devices 545 display images generated by the computer system. The output devices include printers and display devices, such as cathode ray tubes (CRT) or liquid crystal displays (LCD). Some embodiments include devices such as a touchscreen that function as both input and output devices.

Finally, as shown in FIG. 5, bus 505 also couples computer system 500 to a network 565 through a network adapter (not shown). In this manner, the computer can be a part of a network of computers (such as a local area network (“LAN”), a wide area network (“WAN”), or an Intranet, or a network of networks, such as the Internet. Any or all components of computer system 500 may be used in conjunction with the invention.

Some embodiments include electronic components, such as microprocessors, storage and memory that store computer program instructions in a machine-readable or computer-readable medium (alternatively referred to as computer-readable storage media, machine-readable media, or machine-readable storage media). Some examples of such computer-readable media include RAM, ROM, read-only compact discs (CD-ROM), recordable compact discs (CD-R), rewritable compact discs (CD-RW), read-only digital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM), a variety of recordable/rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc.), flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc.), magnetic and/or solid state hard drives, read-only and recordable Blu-Ray® discs, ultra-density optical discs, any other optical or magnetic media, and floppy disks. The computer-readable media may store a computer program that is executable by at least one processing unit and includes sets of instructions for performing various operations. Examples of computer programs or computer code include machine code, such as is produced by a compiler, and files including higher-level code that are executed by a computer, an electronic component, or a microprocessor using an interpreter.

While the above discussion primarily refers to microprocessor or multi-core processors that execute software, some embodiments are performed by one or more integrated circuits, such as application specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs). In some embodiments, such integrated circuits execute instructions that are stored on the circuit itself.

As used in this specification, the terms “computer”, “server”, “processor”, and “memory” all refer to electronic or other technological devices. These terms exclude people or groups of people. For the purposes of the specification, the terms display or displaying means displaying on an electronic device. As used in this specification, the terms “computer readable medium,” “computer readable media,” and “machine readable medium” are entirely restricted to tangible, physical objects that store information in a form that is readable by a computer. These terms exclude any wireless signals, wired download signals, and any other ephemeral or transitory signals.

While the invention has been described with reference to numerous specific details, one of ordinary skill in the art will recognize that the invention can be embodied in other specific forms without departing from the spirit of the invention. For instance, several figures conceptually illustrate processes. The specific operations of these processes may not be performed in the exact order shown and described. The specific operations may not be performed in one continuous series of operations, and different specific operations may be performed in different embodiments. Furthermore, the process could be implemented using several sub-processes, or as part of a larger macro process. Thus, one of ordinary skill in the art would understand that the invention is not to be limited by the foregoing illustrative details, but rather is to be defined by the appended claims. 

1-20. (canceled)
 21. A method of performing a service on a multicast data message at an edge between a source network and a destination network, the method comprising: determining that the data message from the source network is a multicast data message (i) that is addressed to multiple destinations in the destination network and (ii) that requires a particular service; changing a multicast destination network address to a unicast network address associated with a service node that performs the particular service; providing the data message to the service node to perform the service and return a service data message; and after receiving the serviced data message from the service node, changing the destination network address of the serviced data message to the multicast network address, before forwarding the serviced data message to the destination network to forward to the multiple destinations.
 22. The method of claim 21, wherein the destination and unicast network addresses are media access control (MAC) addresses.
 23. The method of claim 21, wherein said determining comprises comparing a set of header values associated with the data message with a set of rules that specify one or more services to be performed, each rule specifying an identifier for a service node to perform the service specified by the rule.
 24. The method of claim 21, wherein said determining comprises: comparing a set of header values associated with the data message with a set of rules that specify one or more services to be performed, in order to identify a rule applicable to the data message, each rule specifying an identifier for the specified by the rule; and selecting the service node from a plurality of service nodes providing the service associated with the identifier specified by the identified rule.
 25. The method of claim 21, wherein said determining comprises analyzing a destination internet protocol (IP) address of the data message.
 26. The method of claim 21, wherein said determining comprises analyzing a destination media access control (MAC) address of the data message.
 27. The method of claim 21, wherein said determining comprises at least one of: using a prefix of an internet protocol (IP) destination address of the data message to determine that the destination address is a multicast destination address; and using the last bit in the first octet of a destination MAC address of the data message to determine that the destination address is a multicast destination address.
 28. The method of claim 21, wherein the source network is a logical network implemented on a physical network, and the destination network is an external network.
 29. The method of claim 21, wherein the service node comprises a service virtual machine that provides the particular service.
 30. The method of claim 21, wherein the service node provides a bump-in-the-wire service that does not change the destination network addresses of the serviced data message.
 31. A non-transitory machine readable medium storing a program which when executed by at least one processing unit performs a service on a multicast data message at an edge between a source network and a destination network, the program comprising sets of instructions for: determining that the data message from the source network is a multicast data message (i) that is addressed to multiple destinations in the destination network and (ii) that requires a particular service; changing a multicast destination network address to a unicast network address associated with a service node that performs the particular service; providing the data message to the service node to perform the service and return a service data message; and after receiving the serviced data message from the service node, changing the destination network address of the serviced data message to the multicast network address, before forwarding the serviced data message to the destination network to forward to the multiple destinations.
 32. The non-transitory machine readable medium of claim 31, wherein the destination and unicast network addresses are media access control (MAC) addresses.
 33. The non-transitory machine readable medium of claim 31, wherein the set of instructions for said determining comprises a set of instructions for comparing a set of header values associated with the data message with a set of rules that specify one or more services to be performed, each rule specifying an identifier for a service node to perform the service specified by the rule.
 34. The non-transitory machine readable medium of claim 31, wherein the set of instructions for said determining comprises sets of instructions for: comparing a set of header values associated with the data message with a set of rules that specify one or more services to be performed, in order to identify a rule applicable to the data message, each rule specifying an identifier for the specified by the rule; and selecting the service node from a plurality of service nodes providing the service associated with the identifier specified by the identified rule.
 35. The non-transitory machine readable medium of claim 31, wherein the set of instructions for said determining comprises a set of instructions for analyzing a destination internet protocol (IP) address of the data message.
 36. The non-transitory machine readable medium of claim 31, wherein the set of instructions for said determining comprises a set of instructions for analyzing a destination media access control (MAC) address of the data message.
 37. The non-transitory machine readable medium of claim 31, wherein the set of instructions for said determining comprises sets of instructions for at least one of: using a prefix of an internet protocol (IP) destination address of the data message to determine that the destination address is a multicast destination address; and using the last bit in the first octet of a destination MAC address of the data message to determine that the destination address is a multicast destination address.
 38. The non-transitory machine readable medium of claim 31, wherein the source network is a logical network implemented on a physical network, and the destination network is an external network.
 39. The non-transitory machine readable medium of claim 31, wherein the service node comprises a service virtual machine that provides the particular service.
 40. The non-transitory machine readable medium of claim 31, wherein the service node provides a bump-in-the-wire service that does not change the destination network addresses of the serviced data message. 